package com.test05;

import java.util.ArrayList;
import java.util.List;

/**
 * @author south wind
 * @version 1.0
 * @date 2025/3/31 22:33
 * @description
 */
public class Player {
    private int id;
    private String name;
    private boolean isLandlord;//ture则玩家是地主
    private List<Card> cards;  //玩家手上卡牌的集合

    public Player(int id, String name) {
        this.id = id;
        this.name = name;
        this.isLandlord = false;
        this.cards = new ArrayList<>();
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public boolean isLandlord() {
        return isLandlord;
    }

    public void setLandlord(boolean landlord) {
        isLandlord = landlord;
    }

    public List<Card> getCards() {
        return cards;
    }

    public void addCard(Card card) {
        cards.add(card);
    }

    @Override
    public String toString() {
        return name + (isLandlord ? "(地主)" : "") + ": " + cards;
    }
}
